<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="utf-8">

    <title>选课信息管理页面</title>
    <!--引入相关的js文件-->
    <link href="../backPage/ui/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="../backPage/ui/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
    <link href="../backPage/ui/waves-0.7.5/waves.css" rel="stylesheet"/>
    <link href="../backPage/ui/jquery-confirm/jquery-confirm.min.css" rel="stylesheet"/>
    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>

    <script src="../backPage/ui/js/jquery-3.3.1.min.js"></script>
    <script src="../backPage/ui/waves-0.7.5/waves.js"></script>
    <script src="../backPage/ui/jquery-confirm/jquery-confirm.min.js"></script>
    <script src="../backPage/ui/bootstrap-3.3.0/js/bootstrap.min.js"></script>
    <script src="../backPage/ui/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
</head>

<body>
<div id="main">
    <div id="toolbar">

        <br/>
    </div>
    <table id="table"></table>
</div>

<script>


    var $table = $('#table');


    $(function() {



        // bootstrap table初始化
        $table.bootstrapTable({
            url: '/studentManageSystem/getChooseCourseInfo',
            height: getHeight(),
            striped: true,

            showRefresh: true,
            showColumns: true,
            minimumCountColumns: 2,
            clickToSelect: true,
            detailView: true,
            pagination: true,
            paginationLoop: false,
            sidePagination: 'server',
            pageList:	[1,10, 25, 50, 100],
            silentSort: false,
            sortOrder: "desc",
            smartDisplay: false,
            escape: true,
            searchOnEnterKey: true,
            idField: 'id',
            maintainSelected: true,
            toolbar: '#toolbar',
            columns: [
                {field: 'ck', checkbox: true},

                {field: 'cid', title: '课程编号',align: 'center'},
                {field: 'coursename', title: '课程名称',align: 'center'},
                {field: 'tid', title: '教师编号',align: 'center'},
                {field: 'teachername', title: '教师名称',align: 'center'},
                {field: 'normalscore', title: '平时成绩',align: 'center'},
                {field: 'testscore', title: '考试成绩',align: 'center'},
                {field: 'finalscore', title: '期末成绩',align: 'center'},
                {field:'q1',title:'工程知识及分析',align:'center'},
                {field:'q2',title:'团队合作与沟通',align:'center'},
                {field:'q3',title:'终身学习',align:'center'},
                {field:'q4',title:'使用现代工具',align:'center'},
                {field:'q5',title:'项目管理',align:'center'},
                {field:'q6',title:'设计/开发解决方案',align:'center'},
                {field:'q7',title:'研究',align:'center'},
                {field: 'state', title: '状态',align: 'center'},
                {field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
            ]
        });
    });

    // 格式化操作按钮
    function actionFormatter(value, row, index) {
        return [
            '<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>　',
            '<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-remove"></i></a>'
        ].join('');
    }
    // 格式化时间
    function timeFormatter(value , row, index) {
        return new Date(value).toLocaleString().split(' ')[0];
    }

    function getHeight() {
        return $(window).height() - 20;
    }



    //创建学生信息
    function createAction(){
        $("#createModal").modal("show");
    }

    function uploadAction() {
        $("#uploadModal").modal("show");
    }




</script>





</body>
</html>